package com.yundasys.lab08jvm.thread;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * @author jiangta
 * @version 1.0
 * @date 2021/6/28 9:16 上午
 */
public class ArrayListNotSafeDemo {

    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        for(int i=0;i<30;i++) {
            new Thread(() -> {
                list.add(UUID.randomUUID().toString().substring(0, 8));
                System.out.println(list);
            },String.valueOf(i)).start();
        }
    }
}
